package com.teamone.etl.constant;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: SixJin
 * @Date: 2021/1/12 21:26
 */
public class EtlConstant {

    /**
     JDBC常量
     */
    public static class JdbcConstant{
        public static final String MYSQL_DRIVER = "com.mysql.cj.jdbc.Driver";
        public static final String MYSQL_PRE = "jdbc:mysql://";

        public static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
        public static final String ORACLE_PRE = "jdbc:oracle:thin:@";

        public static final String SQLSERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        public static final String SQLSERVER_PRE = "jdbc:sqlserver://";

        public static final String ORACLE_TEST_SQL = "select * from v$version";
        public static final String MYSQL_SQLSERVER_TEST_SQL = "select @@version as version";
    }

    /**
     判断类型常量
     */
    public static class TypeConstant{
        public static final int MYSQL = 1;
        public static final int ORACLE = 3;
        public static final int SQL_SERVER = 4;

        public static final Integer REDIS = 2;
        public static final String IS_WORKING = "0";

        public static final Integer CODE_TYPE_JAVA  = 1;
        public static final Integer CODE_TYPE_SQL  = 2;
        public static final String CREATE = "CREATE";
        public static final String DROP = "DROP";
        public static final String ALTER = "ALTER";

        public static final String PHONE = "PHONE";
        public static final String TEL = "TEL";
        public static final String CARD = "CARD";
        public static final String PASSWORD = "PASSWORD";
        public static final String PWD = "PWD";
        public static final String ADDR = "ADDR";
        public static final String ADDRESS = "ADDRESS";
        public static final String NAME = "NAME";
        public static final String USERNAME = "USERNAME";
        public static final String MAIL = "MAIL";
        public static final String EMAIL = "EMAIL";
    }

    public static class MySqlConstant{
        public static final List<String> KEY_WORD = Arrays.asList("PHONE", "TEL", "CARD", "PASSWORD", "PWD", "ADDR",
                "ADDRESS", "NAME","USERNAME", "MAIL", "EMALI");
        public static final String SELECT = "SELECT";
        public static final String SPACE = " ";
        public static final Integer MAX_PAGE_SIZE = 50;
    }

    public static class RuleEngine{
        /**
         * 指定文件位置
         */
        public static final String FOLDER =System.getProperty("user.dir")+"\\etl-dataruleengine\\target\\classes\\com\\teamone\\etl\\dataruleengine\\";
    }

    public static class Number{
        public static final int NONE = 0;
    }

    public static class Api{
        public static final String API_TYPE_ID="apitypeid";
        public static final String API_AMOUNT="apiamount";
        public static final String TOTAL_USE="totaluse";
    }


    public static class Operate{
        public static final String IF_POST = "POST";
        public static final String IF_PUT =  "PUT";
        public static final String IF_DELETE = "DELETE";
        public static final String IF_GET = "GET";
        public static final String IF_CREATEPOST = "createPost";
        public static final String IF_CREATE_USER_FORM = "createUserform";
        public static final String IF_DELETE_USER_BY_ID = "deleteUserById";
        public static final String IF_SELECT_COUNT_POST = "selectCountPost";
        public static final String IF_GET_COUNT_NUMBER = "getCountNumber";
        public static final String IF_UPDATE_PASSWORD = "updateUserformPwd";
    }
}
